#pragma once


#include "RBTree.h"


namespace my_std
{
	template <class K>
	class my_set
	{
		struct MapKeyofT
		{
			const K& operator()(const K& k)
			{
				return k;
			}
		};
		typedef RBTree<K,K, MapKeyofT> RBTree;
		typedef typename RBTree::const_iterator iterator;
		typedef typename RBTree::const_iterator const_iterator;
	public:
		iterator begin()const
		{
			return _rb.begin();
		}

		iterator end()const
		{
			return _rb.end();
		}


		pair<iterator, bool> insert(const K& k)
		{
			pair<RBTree::iterator, bool> ret = _rb.insert(k);
			return pair<iterator, bool>(ret.first,ret.second);
		}

		bool IsBalance()
		{
			return _rb.IsBalance();
		}


		int Height()
		{
			return _rb.Height();
		}

	private:
		RBTree _rb;
	};
}